package com.example.hospital.utils.encipher;

import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.digest.MD5;
import com.example.hospital.constant.Constants;

public class EncipherPwdUtils {
  private static final String encipherStr = Constants.ENCIPHER_STR;
  
  public static String encipherPassword(String password) {
    MD5 md5 = MD5.create();
    String temp = md5.digestHex(encipherStr);
    String start = StrUtil.subWithLength(temp, 0, 6);
    String end = StrUtil.subWithLength(temp, temp.length() - 3, 3);
    return md5.digestHex(start + password + end);
  }
}
